﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using TiaoTaoHelper.Wtm.Units.EFCore;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class 新增站点配置表 : TransactionalMigration
    {
        /// <inheritdoc />
        protected override void UpWithTransaction(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "SysSiteConfig",
                columns: table => new
                {
                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LogoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    CustomGroupCode = table.Column<bool>(type: "bit", nullable: false),
                    CustomJobPositionCode = table.Column<bool>(type: "bit", nullable: false),
                    SmsLogin = table.Column<bool>(type: "bit", nullable: false),
                    WechatLogin = table.Column<bool>(type: "bit", nullable: false),
                    SmsAppId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TenantCode = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysSiteConfig", x => x.ID);
                    table.ForeignKey(
                        name: "FK_SysSiteConfig_FileAttachments_LogoId",
                        column: x => x.LogoId,
                        principalTable: "FileAttachments",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                });

            migrationBuilder.CreateIndex(
                name: "IX_SysSiteConfig_LogoId",
                table: "SysSiteConfig",
                column: "LogoId");
        }

        /// <inheritdoc />
        protected override void DownWithTransaction(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "SysSiteConfig");
        }
    }
}
